package com.huawei.appgallery.datastorage.database.impl.process;

import android.content.ContentValues;
import android.database.Cursor;
import java.lang.reflect.Field;
import o.blw;
import o.bmc;
import o.bmg;

public final class BooleanProcess implements bmc<Boolean> {
    public /* synthetic */ void ˋ(ContentValues contentValues, String str, Object obj) {
        ˎ(contentValues, str, (Boolean) obj);
    }

    public String ˊ() {
        return "INTEGER";
    }

    private int ˊ(Boolean bool) {
        if (bool == null || !bool.booleanValue()) {
            return 0;
        }
        return 1;
    }

    public void ˎ(ContentValues contentValues, String str, Boolean bool) {
        contentValues.put(str, Integer.valueOf(ˊ(bool)));
    }

    public void ˎ(blw o_blw, Field field, Cursor cursor, int i) {
        boolean z = true;
        try {
            if (cursor.getInt(i) != 1) {
                z = false;
            }
            field.set(o_blw, Boolean.valueOf(z));
        } catch (IllegalAccessException e) {
            bmg.ˊ.ˏ("BooleanProcess", "put value failed:IllegalAccessException:" + o_blw.getClass().getSimpleName());
        } catch (Exception e2) {
            bmg.ˊ.ˏ("BooleanProcess", "put value failed:Exception:" + o_blw.getClass().getSimpleName());
        }
    }
}
